diff options
| author | Adam Soltys <[email protected]> | 2024-11-07 21:16:25 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-08 09:27:40 -0800 |
| commit | 32fcc461cd43c8907df5e306d520bb671307eab1 (patch) | |
| tree | 0253780c569998b6c1a5f43026586e94916c3fee /src/routes/(app)/invoice/[id]/[email protected] | |
| parent | be5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff) | |
| download | coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip | |
svelte 5
Diffstat (limited to 'src/routes/(app)/invoice/[id]/[email protected]')
| -rw-r--r-- | src/routes/(app)/invoice/[id]/[email protected] | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/routes/(app)/invoice/[id]/[email protected] b/src/routes/(app)/invoice/[id]/[email protected] index 62c05db1..05fd603f 100644 --- a/src/routes/(app)/invoice/[id]/[email protected] +++ b/src/routes/(app)/invoice/[id]/[email protected] @@ -1,4 +1,6 @@ <script> + import { run } from 'svelte/legacy'; + import { SvelteToast } from "@zerodevx/svelte-toast"; import { onDestroy, onMount } from "svelte"; import { close, connect, send } from "$lib/socket"; @@ -22,16 +24,14 @@ import { t, locale, loading } from "$lib/translations"; import { goto, onNavigate } from "$app/navigation"; - export let data; + let { data, children } = $props(); - let { generate, rate, user, subject, token, rates, theme } = data; + let { generate, rate, user, subject, token, rates, theme } = $state(data); - $: update(data); let update = (data) => { ({ rate, user, subject, token, rates, theme } = data); }; - $: theme = $themeStore; $themeStore = theme; onMount(async () => { @@ -58,7 +58,6 @@ } }); - $: browser && connect(token); let lost, checkTimer, @@ -84,6 +83,15 @@ clearTimeout(expireTimer); } }); + run(() => { + update(data); + }); + run(() => { + theme = $themeStore; + }); + run(() => { + browser && connect(token); + }); </script> {#if browser && user && $passwordPrompt} @@ -110,7 +118,7 @@ <main class="min-h-dvh" data-theme={theme}> <AppHeader {user} {subject} /> {#if !$loading} - <slot /> + {@render children?.()} {/if} </main> |
